The approaches described in this section are approaches that could be pursued, but not necessarily approaches that have been previously conceived or pursued. Therefore, unless otherwise indicated, it should not be assumed that any of the approaches described in this section qualify as prior art merely by virtue of their inclusion in this section.
It is not uncommon to want to make changes to a data container, such as a relational table, after the container has been in use for a while. For example, a relational table may be created with a column X for storing a certain type of data (the “original datatype”). After the table has been in use for a while, a user may want to modify the table to allow column X to store a different type of data (the “new datatype”).
Unfortunately, simply modifying the definition of the table may be insufficient to make such changes, because the new datatype may have a different storage format than the original datatype. Consequently, the “target column” (in this case, column X) may not have the right amount of storage for the new datatype. Therefore, the old column needs to be replaced with a new column with the appropriate amount of storage.
However, creating a new column may also not be enough, since the original column may already contain stored data items that are formatted according to the original datatype. Therefore, in addition to changing the definition of the table and creating a new column, the data items in the original column have to be converted to the format of the new datatype, and then stored into the new column. Once all of the data from the target column has been migrated to the newly-created column, the original column may be dropped.
The bulk migration of target column data items may be accomplished, for example, by issuing a Recursive Procedure Invocation (a recursive SQL call). Unfortunately, the bulk migration of the data items that exist in the target column can take an unacceptably long time, especially for tables that contain millions of rows. Further, the conversion may cause row-chaining and non-locality of data storage.